import 'package:flutter/material.dart';

import 'package:get/get.dart';
import 'package:xmshop/app/widget/passButton.dart';
import '../../../../widget/userAgreement.dart';
import '../../../../widget/passTextField.dart';
import '../controllers/code_login_step_one_controller.dart';
import '../../../../services/screebAdapter.dart';
import '../../../../widget/logo.dart';

class CodeLoginStepOneView extends GetView<CodeLoginStepOneController> {
  const CodeLoginStepOneView({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: AppBar(
        backgroundColor: Colors.white,
        elevation: 0,
        actions: [TextButton(onPressed: () {}, child: const Text("帮助"))],
      ),
      body: ListView(
        padding: EdgeInsets.all(ScreenAdapter.width(40)),
        children: [
          const Logo(),
          PassTextFiled(
            hintText: "请输入手机号",
            onChanged: (value) {},
          ),
          PassButton(
            text: "获取验证码",
            onPressed: () {
              Get.offAndToNamed('/code-login-step-two');
            },
          ),
          const UserAgreement(),
          Container(
            child: Column(
              children: [
                Container(
                  margin: EdgeInsets.only(bottom: ScreenAdapter.width(100)),
                  child: TextButton(
                      onPressed: () {
                        Get.toNamed('register-step-one');
                      },
                      child: const Text('新用户注册')),
                ),
                TextButton(
                    onPressed: () {
                      Get.offAndToNamed('/pass-login');
                    },
                    child: const Text('账号密码登录')),
              ],
            ),
          )
        ],
      ),
    );
  }
}
